//
//  cardtest3.c
//  Dominion
//
//  Eric Hook
//  hooke@onid.orst.edu
//  CS362 Winter 2014
//

#include "dominion.h"
#include "dominion_helpers.h"
#include <string.h>
#include <stdio.h>
#include <assert.h>
#include "rngs.h"

int seed = 1000;
int k[10] = {adventurer, council_room, feast, gardens, mine, remodel, smithy, village, baron, great_hall};

void testCardEffectVerifyMineWontBuyCardCostMoreThan3MoreThanDiscard() {
    int result = 0;
    int card = mine;
    int bonus = 0;
    struct gameState G;
    int tryTurnCopperToGoldFail = 0;
    int tryTurnCopperToSilverSucceed = 0;
    int tryTurnSilverToGoldSucceed = 0;
    
    printf ("TESTING: int cardEffect(int card, int choice1, int choice2, int choice3, struct gameState *state, int handPos, int *bonus) : mine : cardTest3.c.\n");
    
    memset(&G, 23, sizeof(struct gameState));       // clear the game state
    result = initializeGame(2, k, seed, &G);
    assert(result == 0);                            // validate that the game was inititalized correctly
    
    tryTurnCopperToGoldFail = cardEffect(card, copper, gold, 3, &G, 1, &bonus);
    assert(tryTurnCopperToGoldFail == 0);
    tryTurnCopperToSilverSucceed = cardEffect(card, copper, silver, 3, &G, 1, &bonus);
    assert(tryTurnCopperToSilverSucceed == -1);
    tryTurnSilverToGoldSucceed = cardEffect(card, silver, gold, 3, &G, 1, &bonus);
    assert(tryTurnSilverToGoldSucceed == -1);
    
    printf("!!! PASS: Mine card effect metal card conversions");
    
}

int main () {
    testCardEffectVerifyMineWontBuyCardCostMoreThan3MoreThanDiscard();
    return 0;
}